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
Table_Name( attribute_1, attribute_2, attribute_3, ….. ,attribute_x) Primary Key ( attribute_1, attribute_2) Foreign Key attribute_4 References Table_Name_2 (repeat for each fore

(a) Why did SAP introduce the extended star schema?

What is known as sequential file organization? In the sequential file organization, the records are kept in sequential order, according to the value of a "search key" of every

Question: Describe briefly the three parts of the Relational Model. (a) The term integrity refers to the accuracy or correctness of the data in the database. Define the fol

what do you mean by consistency in rdbms?

what would go in order patient#, patient name, patien address, surgeon#, surgeon name, surgery date, surgery type, drug admin

Ask question #MinimRead Dennis et al. Chapter 6: Minicase 2. Work through it and answer the questions. See the attached example. SequenceDiagram.png Based on the structural mod

What are the three classes of SQL expression? SQL expression consists of three clauses:  Select  From  Where

For this application, we will consider IBM DB2 catalog data (i.e., metadata) for IBM's enterprise-class servers running the z/OS (formerly OS/390 or MVS) operating system.  One of

Database design Database tables will be created for you on the Technology web server. The schema will be as follows. Please note that this is a simplified database structure, d