Question

HELP DATABASE QUQuestion 1: Think About the relational database table data as given below, write the following queries in Oracle SQL. Company

0 0
Add a comment Improve this question Transcribed image text
Answer #1
1. Below is the SQL query where we define table Company with CID of type INT and set as primary key, Cname as string with 50 characters and it cannot be NULL, then we define City of type string with 50 characters, then Budget is of type INT and finally Branch is of type string with 50 characters. CREATE TABLE Company ( CID INT PRIMARY KEY, Cname VARCHAR(50) NOT NULL, City VARCHAR(50) ,   Budget INT, Branch VARCHAR(50) );

2.  

Select Ename from Employee

Where City = "Seattle" and Salary > 20000 ;

3.  

CREATE VIEW Emp_info  AS
SELECT Ename, Deptno , Street, City, Phone
FROM Employee;

Here we created view name Emp_info where we highlighted all details of Employee except Salary by importing all the attributes of table Employee except Salary.

Please comment for any clarification.

Add a comment
Know the answer?
Add Answer to:
HELP DATABASE QU Question 1: Think About the relational database table data as given below, write...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Given the following relational schema, write queries in SQL to answer the English questions. There is...

    Given the following relational schema, write queries in SQL to answer the English questions. There is a shipment database on the MySQL server. You can also use the DDL for MySQL. You must only submit the SQL for your answers but you can include the query output as well to help the TA with marking. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid: integer, shipdate: Date/Time) ShippedProduct(sid:...

  • Consider the relational database schema for a company below. EMPLOYEE/NAME, SSN, BDATE, ADDRESS, SEX, SALARY, SUPERSSN,...

    Consider the relational database schema for a company below. EMPLOYEE/NAME, SSN, BDATE, ADDRESS, SEX, SALARY, SUPERSSN, DNA) TA DEPARTMENT(DNAME, DNUMBER. MESSINS, MGRSTARTDATE) DEPT_LOCATIONS(DNUMBER. DLOCATION PROJECT(PNAME, PNUMBER. PLOCATION, DNLIM) WORKS_ONCESSN.PNG, HOURS) DEPENDENTESSN, DEPENDENT-NAME, SEX, BDATE, RELATIONSHIP) Write SQL statements for the following queries: a) List the names of those employees who work in the "Production" department (6 marks). b) Find the maximum salary, minimum salary, and the average salary among employees who work for the "Production department (6 marks). Count the...

  • SQL Query Question: I have a database with the tables below, data has also been aded...

    SQL Query Question: I have a database with the tables below, data has also been aded into these tables, I have 2 tasks: 1. Add a column to a relational table POSITIONS to store information about the total number of skills needed by each advertised position. A name of the column is up to you. Assume that no more than 9 skills are needed for each position. Next, use a single UPDATE statement to set the values in the new...

  • This is extra information about the shopping database given to answer this question: For many query...

    This is extra information about the shopping database given to answer this question: For many query questions we refer to the following database schema for a website that keeps track of what people like to buy or actually buy in different on-line supermarkets. (Think of something like a cross-store loyalty card system.) customer(cID, cName, street, city) Customers with unique cID and other attributes store(sID, sName, street, city) Stores with a unique ID and other attributes. Stores with the same name...

  • database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED...

    database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED BELOW CREATE TABLE Department ( DECIMAL(5) VARCHAR(30) CHAR(5) DATE NOT NULL NOT NULL NOT NULL * Department number /*Department name * Department manager number */ /Manager start date DNumber DName Manager MSDate CONSTRAINT Department_PK PRIMARY KEY(DNumber) CONSTRAINT Department_CK UNIQUE(DName) CREATE TABLE DeptLocation DECIMAL(5) VARCHAR(50) NOT NULL NOT NULL DNumber * Department number */ * Department location */ Address CONSTRAINT DeptLocation_PK PRIMARY KEY(DNumber, Address) CONSTRAINT...

  • 1. {90 points} Your task is to design a 'Company database capable of storing information about...

    1. {90 points} Your task is to design a 'Company database capable of storing information about EM- PLOYEE(S), DEPARTMENT(s), and PROJECT(s). Knowing that: We store each employee's name composite attribute - {10 points}), social security number, address, salary, and telephone number. An employee is assigned to one department, but may work on several projects which are not necessarily controlled by the same department. We keep track of the number of hours that an employee works on each project - {10...

  • DATABASES You are required to design and implement a relational database to help the local community...

    DATABASES You are required to design and implement a relational database to help the local community center better serve the residents in your neighborhood. Database Specifications: In your preliminary analysis, you have determined the following basic facts about the community center and the services it provides to the residents in the neighborhood: - The community center serves multiple areas which fall into different zip codes.  - The community center provides collaborative family based care services. An immediate family is...

  • Question 2 (60 points): You need the Sales OrdersExample database to complete this project. To install...

    Question 2 (60 points): You need the Sales OrdersExample database to complete this project. To install the database, first, download Data code 1 and run it, then download Data code 2 and run (provided on D2L). Now answer the following questions. 2.1: (20 Points) Use the customers' table inside of the salesordersexample database, and write a query statement to show records from the CustFirstName, CustLastName, and CustCity columns 2.2: (20 Points) Use the employees' table inside of the salesordersexample database,...

  • Part. II Please draw ER Diagram and write relational data model for the following business. 1....

    Part. II Please draw ER Diagram and write relational data model for the following business. 1. IT Training IT Specialists is a company to provide IT courses in programming, database development and Web applications. Business rules include: » Each course is identified by a unique course number (cNo) and other course attributes include: course name (cName), course description, pre-requirements . At least one and up to many sections can be offered by each course. » Each section is identified by...

  • New to DB's Please help! You are designing and creating a database named COMPANY for an HR (Human Resource) Dept of...

    New to DB's Please help! You are designing and creating a database named COMPANY for an HR (Human Resource) Dept of a Software Consulting Company to manage their employees and their assigned work (projects) in the company First Step to Design and Create a Database is Creating an E-R Diagram by Identifying Entities, Attributes and Relationships between any two Entities to Create a Company Database Scheme. 1. Create an E-R Diagram for the Company database from the raw data files...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT