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
Draw an entity relationship diagram (ERD) for the following situation: A company has a number of employees. Each employee is identified by an Employee_Id. The company wants to st

Support by Adding Indexes Multiple indexes can be used to access a data file by multiple access paths. In such a scheme only single copy of the data is consider, only the numbe

Explain the term - Control as Concurrent Tasks As we know, any object can be implemented as a task in programming language or operating system. This is the most general approa

List the Armstrong's axioms for functional dependencies.  What do you understand by soundness and completeness of these axioms?      Ans: The Armstrong's axioms are: F1:

Define the Canonical cover Ans: A canonical cover F c for F is a set of dependencies like F logically implies all dependencies in F c , and F c logically entails all dependen

From SAD to OOAD (Structured Analysis and Design (SAD) to Object Oriented Analysis and Design (OOAD). We will find here how we can map various models in SAD to different model


1.  Define each of the following IN YOUR OWN WORDS: (a)   File: (b)   Record: (c)   Field: (d)   Primary Key: (e)   Secondary Key: 2.  A travel agency wants t

The State of NewYork certifies firefighters throughout state and keep track all of them, as well as of the state’s fire departments. Each fire department has unique department numb

Define the terms i) Key attribute ii) Value set Key attribute: An entity type usually has an attribute whose values are exact from each individual entity in the collection. Su