Home »
Archive by category "Online Computer Education" (Page 8)
UPDATE COMMAND– This command is used to update the attribute values of one or more tuples in a table. For example in the Teacher table, we want to update the Dept_No of teachers teaching computer science to 123. This can be done using the following command: UPDATE Teacher SET Dept_No=123 WHERE Subject=”Computer Science”; We can also use the SELECT command in the WHERE clause of UPDATE command if we have to...
Continue reading »
December 28, 2015 evirtualguru_ajaygourOnline Computer EducationNo Comment
INSERT COMMAND – This command is used to insert a tuple in a relation. We must specify the name of the relation in which tuple is to be inserted and the values. The values must be in the same order as specified during the Create Table command. For example, consider the following table Teacher: CREATE TABLE Teacher ( Teacher_Namevarchar(20) NOT NULL, Teacher_IDinteger, Dept_Nointeger DEFAULT 234, Subject varchar(20) ); ...
Continue reading »
December 28, 2015 evirtualguru_ajaygourOnline Computer EducationNo Comment
ALTER TABLE COMMAND– This command is used to modify the base table definition. The modifications that can be done using this command are: Adding a column: Suppose we want to add a column Date_of_Birth in the Teacher table. Following command is used to add the column: ALTER TABLE Teacher ADD Date_of_Birth date; Teacher table is shown before and after the modification in the following figure: Dropping a column: A column can...
Continue reading »
December 28, 2015 evirtualguru_ajaygourOnline Computer EducationNo Comment
DROP TABLE COMMAND:This command is used to delete tables. For example, suppose you want to drop the Teacher table then the command would be: DROP TABLE Teacher CASCADE; Thus Teacher table would be dropped and with the CASCADE option, all the constraints that refer this table would also be automatically dropped. However if the requirement is that the table should not be dropped if it is being referenced in...
Continue reading »
December 28, 2015 evirtualguru_ajaygourOnline Computer EducationNo Comment
CREATE TABLE COMMAND This command is used to create a new table or relation. The syntax for this command is : Create Table <table name> ( <column 1><data type> [constraint] , <column 2><data type>[constraint], <column 3><data type>[constraint] ); where []=optional The keyword “Create Table” is followed by the name of the table that you want to create. Then within parenthesis, you write the column definition that consists of column name...
Continue reading »
December 23, 2015 evirtualguru_ajaygourOnline Computer EducationNo Comment
Structured Query Language (SQL ) SQL is a language that is used to manage data stored in a RDBMS. It is a Data definition language (DDL) and a Data manipulation language (DML) where DDL is a language which is used to define structure and constraints of data and DML is used to insert, modify and delete data in a database. SQL commands are used to perform all the operations....
Continue reading »
December 23, 2015 evirtualguru_ajaygourOnline Computer EducationNo Comment
Relational Model Constraints Constraints are restrictions on the values stored in a database based on the requirements. For example, in the relation EMPLOYEE, the Employee_ID must be a 4-digit number, the Date_of_Birth must be such that the age of employee should be >= 18 and <=65. Following are the various types of constraints in Relational Model: Domain Constraint–It specifies that the value of every attribute in each tuple must...
Continue reading »
December 23, 2015 evirtualguru_ajaygourOnline Computer EducationNo Comment
Relational Database Various types of databases were developed. One of them was relational database which was developed by E.F Codd at IBM in 1970. It is a collection of data items organized as a collection of relations where each relation corresponds to a table of values. A table consists of rows and columns. Each row in the table corresponds to a unique instance of data and each column is used...
Continue reading »
December 11, 2015 evirtualguru_ajaygourOnline Computer EducationNo Comment
Page 8 of 13« Prev
1
…
5
6
7
8
9
10
11
…
13
Next »