Week 1
Week 1
CREATION OF DATABASE:
Syntax:
Mysql>create database databasename;
Output:
d.
Exp 2:
Aim: Create department table with the following structure and answer the following quries.
Name Type
Deptno Integer
Deptname Varchar(20)
location Varchar(20)
Output:
d.
Output:
Output:
Output:
e.
Output:
'Dustin', , 45.0 ); Sql> INSERT INTO sailors ( sid, sname, rating, age )
Exp 6:
Aim: To Create a table called reserves table and answer the following queries
Sql> CREATE TABLE reserves ( sid integer not null, bid integer not null, day
datetime not null, CONSTRAINT PK_reserves PRIMARY KEY (sid, bid, day),
FOREIGN KEY (sid) REFERENCES sailors(sid), FOREIGN KEY (bid) REFERENCES
boats(bid) );
Output:
Output: