Unit3 Database Management System
Unit3 Database Management System
(12) State the relationship between primary key and foreign key
Ans. A primary key – foreign key relationship defines a one to many
relationships between two tables in RDBMS . A foreign key is a
column or set of columns in one table that references the primary
key columns in another table.
Ans.
Ans.
(17) Explain data types? Why are data types used in DBMS /RDBMS?
Tuples Attributes
1 It is row in table and also It is column in table and also
called as record called as field
2 It is set of data value of It is the collection of information
particular data type about the columns of table for
single instance
Ans. File extension for database created using open office Base is
*.odb
(25) List any three file formats that can be managed using
OpenOffice.Org ?
Ans.
Document type Application Extension
Presentation Template Impress *.odp
Word processor writer *.odt
Spreadsheet Calc *.ods
Ans. To edit the data in the table click on Edit data icon or double
click on the data in the cell
The following query will update the ADDRESS for a customer whose
ID is 2
UPDATE Customer SET ADDRESS = ‘PUNE’ where ID = 2;
(37) a) The structure of a table “ITEM” is given below. Suggest
suitable data type and size of each column.
Write queries to
i. Display the total amount of each item. The amount must be
calculated as the price multiplied by quantity for each item.
ii. Display the details of items whose price is less than 50.
Ans.
i. Select price * quantity from item;
ii. Select * from item where price < 50;
(39) remember the syntax of different queries and do practice
(1) select * from <table name>;
(2) select field name from table name;
(3) select * from table name where condition;
(4) select * from table name order by fieldname ASC;
(5) select * from table name order by fieldname DESC;
(6) Select * from table name where condition order by asc/desc;
(7) insert into <table name> (comma separated list of fields) values
(comma separated list of values)
(8) update <table name> set <field name> = value where <criteria>
(9) Delete from <table name> where <criteria>
(10) create TABLE <table name> ( <field name> <datatype> , ….. );