Question

Given the following table structure, write the SQL code to display all the first and last names of the individuals that have
Given the following table structure, write the SQL code to display all the first and last names of the individuals that have
CREATE TABLE Books (ISBN VARCHAR2(10), Title VARCHAR2(30) PubDate DATE PubID NUMBER (2), Cost NUMBER (5,2), Retail NUMBER (5,
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

SELECT FirstName, LastName FROM Persons WHERE LastName like 'M%' ;

(SELECT is used to select the columns

FROM is used to mention the table name

WHERE is used to filter out the rows)

---------------------------------------------------------------------------------------------------------------------------------------------------------

2.

SELECT FirstName, LastName FROM Persons WHERE LastName NOT LIKE '%S%' ;

(SELECT is used to select the columns

FROM is used to mention the table name

WHERE is used to filter out the rows)

---------------------------------------------------------------------------------------------------------------------------------------------------------

3.

SELECT COUNT() FROM Persons WHERE Category = 'Cooking' ;

(The count(ISBN) function is used find the count of the rows filter)

Add a comment
Know the answer?
Add Answer to:
Given the following table structure, write the SQL code to display all the first and last...
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
  • How would you list the title and publication date for each book in the BOOKS table....

    How would you list the title and publication date for each book in the BOOKS table. Use the column heading “Publication Date” for the Pubdate field? Using SQL. Nane Null? Type ISBN TITLE PUBDATE PUBID COST RETAIL DISCOUNT CATEGORY NOT NULL VARCHAR2(10) VARCHAR2(30) DATE NUMBER(2) NUMBER(5,2) NUMBER(5,2) NUMBER(1,2) VARCHAR2(12)

  • Please help me on the SQL queries, thank you so much. Write a query to display the title and publisher as well as the p...

    Please help me on the SQL queries, thank you so much. Write a query to display the title and publisher as well as the publisher contact for each book using JOIN...USING clause. Write a query to show the first and last names of customers who have ordered cooking books. Use the WHERE clause to join the tables. Write a query to show the title, cost and ISBN of each book in the books table. If the book has been ordered,...

  • SQL Command - Create a view called S LIST that lists the Cardholder Number, last name,...

    SQL Command - Create a view called S LIST that lists the Cardholder Number, last name, first name and due date for all cardholders who have not returned a book. Use the CREATE OR REPLACE VIEW AS ... command. TABLE CARD HOLDERS Cardholder Numberint NOT NULL CONSTRAINT CH PK PRIMARY KEY, First_Name varchar(10) NULL, LastName varchar(15) NULL, Address varchar(20) NULL, varchar(15) NULL, State char(2) NULL, Zip_Code char(5) NULL) City TABLE BOOKS CHECKED OUT Cardholder_Numberint NOT NULL, Book Numberint NOT NULL,...

  • I need to create a SQL query that displays the names of the customers who purchased...

    I need to create a SQL query that displays the names of the customers who purchased the book with the highest retail price in the database. Also I need to capitalize the first and last names. CUSTOMERS Table: CUSTOMER#, LASTNAME, FIRSTNAME, ADDRESS, CITY, STATE, ZIP, REFERRED, REGION, EMAIL ORDERS Table: ORDER#, CUSTOMER#, ORDERDATE, SHIPDATE, SHIPSTREET, SHIPCITY, SHIPSTATE, SHIPZIP, SHIPCOST ORDERITEMS Table: ORDER#, ITEM#, ISBN, QUANTITY, PAIDEACH

  • Write SQL Queries Given the following tables (7pts) Retrieve the names of employees and their project...

    Write SQL Queries Given the following tables (7pts) Retrieve the names of employees and their project name. If the employee never worked on a project, show the names only the name, not the project name. (7pts) Retrieve the names of employees who have worked on the same project at a different location. (7pts) Retrieve the names of employees who have worked on more than two different projects. (7pts) Retrieve the names of employees who manage more than two employees. CREATE...

  • /* I am executing following SQL statement for the below code but I am getting error....

    /* I am executing following SQL statement for the below code but I am getting error. Pls, upload screenshot after running it. SQL Statement: SELECT OfferNo, CourseNo FROM Offering WHERE OfferTerm = 'Sum' AND OfferYear = 2012 AND FacSSN IS NULL; */ CREATE TABLE STUDENT( StdSSN INT NOT NULL PRIMARY KEY, StdFName VARCHAR2(50), StdLName VARCHAR2(50), StdCity VARCHAR2(50), StdState VARCHAR2(2), StdZip VARCHAR2(10), StdMajor VARCHAR2(15), StdYear VARCHAR2(20) ); CREATE TABLE FACULTY( FacSSN INTEGER NOT NULL PRIMARY KEY, FacFName VARCHAR(50), FacLName VARCHAR(50), FacCity...

  • Write the following SQL statements in Microsoft Access by using the Books database from Week 2...

    Write the following SQL statements in Microsoft Access by using the Books database from Week 2 Assignment 2. Once complete, copy and paste the SQL statements in a Microsoft Word document: Write SQL statements: To update the publisher name from READ WITH US to READ FOR US To verify the updated name field for the publisher with ID 6 To make the following updates to the Publisher table (be careful with WHERE): Make Contact="John Travolta" for publisher with ID number...

  • Step 1: Create table audits via triggers The system must log any insertion, deletion, or updates...

    Step 1: Create table audits via triggers The system must log any insertion, deletion, or updates to the following tables: • Employee table (project 1) create table Employee ( empNumber char(8) not null, firstName varchar(25) null, lastName varchar(25) null, ssn char(9) null, address varchar(50) null, state char(2) null, zip char(5) null, jobCode char(4) null, dateOfBirth date null, certification bit null, salary money null, constraint PK_EMP PRIMARY KEY(empNumber), constraint EMP_STATECHECK CHECK(state in ('CA','FL')) ) GO • Job table (project 1) create...

  • Write a SQL query that shows the price of each order made by customers whose last name starts wit...

    Write a SQL query that shows the price of each order made by customers whose last name starts with the letter M. Display the order number, the last name on the order, and the price of the order (Order Price). Show the results with the highest order price first. Write a SQL query that determines the most expensive item purchased in each order (Item Price). Display the order number, the date of the order, the last name of the customer...

  • You will create the following 4 triggers: - trgEmployee: Will be placed on the Employee table...

    You will create the following 4 triggers: - trgEmployee: Will be placed on the Employee table and listens for Inserts, Deletes, and Updates - trgJob: Will be placed on the Job table and listens for Inserts, Deletes, and Updates - trgProject: Will be placed on the Project table that contains the projectId and projectName. - trgActivity: Will be placed on the Activity table that contains the activityId and activityName. Again, each trigger will write to its respective audit table: trgProject...

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
Active Questions
ADVERTISEMENT