Write an sql create table statement

Assignment Help Database Management System
Reference no: EM131724114

Use the following information for problems 4 - 10:

Tables: PET_OWNER (OwnerID, OwnerLastName, OwnerFirstName, OwnerPhone, OwnerEmail)

PET (PetID, PetName, PetType, PetBreed, PetDOB, OwnerID)

**Note: OwnerID is italicized to indicate the Foreign Key**

Data: Write an SQL CREATE TABLE statement to create the PET_OWNER table, with OwnerID as a surrogate key. Save as Create

PetOwner. Write a set of SQL INSERT statements to populate the PET_OWNER table with the data given above. Save as PopulatePetOwner. Write an SQL CREATE TABLE statement to create the PET table, with PetID as a surrogate key. Save as CreatePet.

Write a set of SQL INSERT statements to populate the PET table with the data given above.

Save as PopulatePet. Write an SQL statement to display the breed and type of all pets. Save as AllBreeds. Write an SQL statement to display the breed, and DOB of all pets having the type Cat.

Save as Cats. Write an SQL statement to display the first name, last name, and email of all owners, sorted in alphabetical order by last name.

Save as AlphaOwners. Write an SQL statement to display all the owners' names, with the first name in all lower case and the last name in all upper case. Save as UpperLower. Write an SQL statement to display the total number of pets.

Write an SQL statement to display the last name, first name and email of any owner who has a NULL value for OwnerPhone. (Note: there should be one owner who has a NULL value for OwnerPhone.) Save as PhoneNull.

Write an SQL statement to count the number of distinct breeds. Save as NumberOfBreeds. Write an SQL statement to display the names of all the dogs. Save as Dogs.

Verified Expert

Firstly I created a dummy database in Sequel Pro then created two tables named as PET_OWNER and PET having the same attributes as specified in assignment then inserted the values in tables as such way so that rest of the operation in the assignment can be performed easily and changes for different query should be prominent and thereafter performed rest of the SQL queries.

Reference no: EM131724114

Questions Cloud

Processing and arrival times on average waiting time : What is the impact of variability in processing and arrival times on average waiting time? Why does this occur?
Difference between principles and rules based standards : What is the difference between principles-based and rules-based accounting standards
Concept of moment of truth in a service context : Review the concept of moment of truth in a service context.
Explain how host x obtains the mac address of host z : Explain how host X obtains the MAC address of host Z. Describe how switch S handles the ARP request and response messages, and builds its switch table.
Write an sql create table statement : Write an SQL statement to display the total number of pets - Write a set of SQL INSERT statements to populate the PET table
Risk of colon cancer for frequent beer drinkers : If you were a frequent beer drinker and were worried about getting colon cancer, would it be more informative to you to know the risk of colon cancer.
Relationship between sex and handedness : Based on these observed data, do you think there is a relationship between sex and handedness in the population represented by this sample?
Technical competency domain of people : What HR functional areas within the technical competency domain of people do you believe will be impacted the most by future trends? How?
Features that predict relatively high levels of disclosure : ACC312 - International Managerial Accounting. Discuss characteristics or features that predict relatively high levels of disclosure in Mexico

Reviews

Write a Review

Database Management System Questions & Answers

  Maintain data on the various federal agencies

The U.S. government wants to keep track of information about states, governors, cities, and mayors. In addition, it wants to maintain data on the various federal agencies and the annual grants each agency gives to the individual states.

  Design relational database contain information of physicians

Design a relational database containing information about the physicians, patients, patient history, patient payment history, and patient medications.

  Analyze reason why entity relationship modeling is important

Analyze the key reasons why entity relationship modeling is important, and determine at least way in which it impacts the overall development of the database.

  What is a relational database

What is a relational database, the purpose and function of relationships? What is the relevance of primary keys?

  Retrieve all the data in the project table

How many projects do John New and Alice Johnson work on - Which Job Class is the second highest Charge Hour in the table and List all the employees in alphabetical order - CREATE TABLE for every table (entity) represented on the ER Diagram

  Write a query or queries to print the table description

Write a query or queries to print the table description and the contents of each table, and copy and paste the results to a file called sales. Write a 1- to 2-page paper describing each constraint you created and why it is necessary.

  Draw an er diagram for your proposed database

Draw an ER diagram for your proposed database. You need to show attributes, primary keys, and relationships (needs to use Chen and Crows feet notation)

  Discuss about the normalization

Discuss about the Normalization.What errors prevent the table displayed above from being first normal form compliant? Be specific, identifying all columns that create the normalization error by name.

  Display all the lastnames from the customers table

Display all the LastNames from the Customers table and any associated OrdersIDs from the Orders Table. Show the LastName even if they do not have any associated orders. Order the results by LastName in ascending order.

  Draw an er diagram for database scenario

Draw an ER diagram for database scenario. Design a set of 3NF tables for your database scenario.

  How much of the total materials handling cost

How much of the total materials handling cost would be allocated to the wall mirrors - the materials handling cost is allocated on the basis of material moves

  Find the optimal assignment to minimize employee travel time

A real estate firm wishes to open four new offices in the Boston area. There are six potential sites available. Based on the number of employees in each office.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd