The document outlines steps to create a database with two tables - an employee table to store employee details and a company_car table to store details of company cars including the employee number of the owner. It specifies to include primary keys, foreign keys, and commands to modify the tables by adding and removing columns.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
32 views3 pages
Assignment
The document outlines steps to create a database with two tables - an employee table to store employee details and a company_car table to store details of company cars including the employee number of the owner. It specifies to include primary keys, foreign keys, and commands to modify the tables by adding and removing columns.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3
Assignment
1. Create a database to store information.
2. Create a table, called employee, to store details of employee information such as employee number, name of employee, date of birth, salary etc. 3. Create a table, called company_car, to hold details of a pool of company cars. The attributes are: registration number, type of car, year of manufacture, date of last service, next service mileage, and employee number of owner. 4. Don't forget the primary key and any foreign key definitions. 5. Add an appropriate DROP command before the CREATE command. 6. List number of tables in your database. 7. Show structure of the two tables: employee and company_car. 8. Modify employee table by adding a column to hold the mobile number of an employee. 9. Modify employee table by removing the date of birth column. Create the following tables with the given structures as specified: Assignment 2 SALESPEOPLE CUSTOMERS ORDERS Snum INT Cnum INT Onum INT Sname VARCHAR(50) Cname VARCHAR(50) Amt DECIMAL(7,2) City VARCHAR(50) City VARCHAR(50) Odate DATE Comm DECIMAL(3,2) Rating INT Cnum INT Snum INT Snum INT
Add a column named “DateOfBirth” with datatype (date) in “SALESPEOPLE” table.
Change the data type of the column named “DateOfBirth” (date) to datatype (datetime) in the “SALESPEOPLE” table. Delete the column named “DateOfBirth” in the “SALESPEOPLE” table.