MyCompany employee person street city works person departmen
MyCompany
employee (person, street, city)
works (person, department_name, salary)
department (department_name, building)
Using the relational database, MyCompany, write the following SQL commands:
Create the relation works
Enter three employees into the database. One should be you. One of the others should not yet have a salary figure.
Solution
/* this is done in sql, creating the table works and inserting the values into the table. */
CREATE TABLE WORKS(
person VARCHAR(20),
department_name VARCHAR(20),
salary INT(10)
);
INSERT INTO works VALUES(\"STUDENT1\",\"DEPARTMENT1\",10000);
INSERT INTO works VALUES(\"STUDENT2\",\"DEPARTMENT2\",20000);
INSERT INTO works(person,department_name) VALUES(\"STUDENT3\",\"DEPARTMENT\");
