Create table employee and enter employee data in sql, Database Management System

Create table employee and enter employee data in SQL?

Consider the following relational schemas:
EMPLOYEE (EMPLOYEE_NAME, STREET, CITY)
WORKS (EMPLOYEE_NAME, COMPANYNAME, SALARY)
COMPANY (COMPANY_NAME, CITY)
Specify the table definitions in SQL.

Ans. CREATE TABLE EMPLOYEE
( EMPLOYEE_NAME VARCHAR2(20) PRIMARY KEY,
STREET VARCHAR2(20),
CITY VARCHAR2(15));
CREATE TABLE COMPANY
( COMPANY_NAME VARCHAR2(50) PRIMARY KEY,
CITY VARCHAR2(15));
CREATE TABLE WORKS
( EMPLOYEE_NAME VARCHAR2(20)
REFERENCES EMPLOYEE(EMPLOYEE_NAME,
COMPANYNAME VARCHAR2(50)
REFERENCES COMPANY(COMPANY_NAME,
SALARY NUMBER(6),
CONSTRAINT WORKS_PK PRIMARY KEY(EMPLOYEE_NAME,
COMPANY_NAME));

Posted Date: 5/10/2013 2:10:28 AM | Location : United States







Related Discussions:- Create table employee and enter employee data in sql, Assignment Help, Ask Question on Create table employee and enter employee data in sql, Get Answer, Expert's Help, Create table employee and enter employee data in sql Discussions

Write discussion on Create table employee and enter employee data in sql
Your posts are moderated
Related Questions
a need some real life examples of database management systems three level of ANSI SPARC architecture life teacher and student ,company and employee or for NGO etc.

QUESTION (a) Give two advantages of using Linked List as compared to arrays. (b) (i) You are working as programmer at the Orange Mauritius branch. You have been asked to cre

Whenever the LIMIT clause will be used? LIMIT is used for the following kinds of problems: 1) Answering questions about first or last and largest or smallest 2) Splitting

Boyce-Code Normal Form (BCNF) A relationship is said to be in BCNF if it is already in 3NF and the left hand side of each dependency is a candidate key. A relation who is in 3N

What is a foreign key, and what is it used for? A foreign key is used to establish relationships between relations in the relational model. Technically, a foreign key is a colu

Given the following set of functional dependencies {cf→ bg, g → d, cdg → f, b → de, d → c} defined on R(b,c,d,e,f,g) a. Is cf→ e implied by the FDs? b. Is dg a superkey?

Explain the disadvantages of using DBMS There could be a few disadvantages of using DBMS. As DBMS requires computers, we have to invest a good amount in acquiring the hardwa

Describe domain constraints. Domain constraints contain entity integrity and referential integrity. The domain is a set of values that might be assigned to an attribute. The en

What is difference between TRUNCATE and DELETE? - Truncate can't be rolled back whereas Delete can be. - Truncate keeps the lock on table whereas Delete keeps the lock on ea

Gyan Gurukul is a software company that provides software related solution. Ashutosh Dubey who is the director of Gyan Gurukul want a three-level schema architecture for the Gyan G