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

What is a function group? A function group is a collection of logically related modules that share global data with every other.  All the modules in the group are contained in

Find the names of all Albums that have more than 30 tracks. Result: (name: varchar(255))

assume we have the following apllicationthat model sccer team the games they play and the players inv each teamin the design we want to capture


what is lossless & dependency preserving decomposition ?

explain various steps uses in evaluation and maintenance of MIS.

Explain three main attributes of data.

Write short notes on relational constraints? Relational Constraints are: 1. NOT NULL 2. Unique 3. Primary key 4. Foreign key 5. Table check

Consider employee (e_no, e_name, e_salary, d_code), dept (d_code, d_name) and dependent (depndt_name, e_no, relation). Show the names of employees in purchase and accounts departm