Question

In: Computer Science

What is an SQL? Is SQL a standard? Explain. 1B- What are the two categories of...

What is an SQL? Is SQL a standard? Explain.
1B- What are the two categories of SQL statements. Give examples for each category.


2- Consider the logical schema below:

PET_OWNER(OWNER_ID [N, 18], FIRST_NAME [A, 250], LAST_NAME [A, 250], PHONE [A, 50], EMAIL [A, 250])
PET(PET_ID [N, 18], PET_NAME [N, 18], PET_TYPE [A, 20], BREED [A, 50], DOB [D, 10], OWNER_ID [N, 18])

A- Write an SQL statement to create a database named PET_OWNER_DB
B- Write SQL statements to create PET_OWNER and PET tables. You must create the relationship using SQL as well.
C- Write SQL statements to insert one row of data into PET_OWNER table and one row of data into PET table. Use the below data:
For PET_OWNER use: OWNER_ID=1, FIRST_NAME=Marsha, LAST_NAME=Downs, Phone: 240-855-2345, [email protected]
For PET use: PET_ID=1, PET_NAME=King, PET_TYPE=Dog, BREED=Cashmere, DOB=27-Feb-14, OWNER_ID=1
D- Which table's data must be inserted first?

Please donot close the question. paraphrase anything needed please.

Solutions

Expert Solution

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

SQL :

  • SQL stands for Structured Query Language.
  • SQL is a standard given by ANSI which is a used to communicate with database like mySQL , SQL Server , Oracle etc.

Question 1B :

  • SQL having different SQL statements to communicate with the database like
  • Data Definition Language (DML) :used to create table , database ,
  • Data Manipulation Language (DML) :Used for data manipulation like insert , update etc.

*******************************

This demonstration is using SQL Server 2014.

Database :

/*create database PET_OWNER_DB*/
create database PET_OWNER_DB;

/*use PET_OWNER_DB to create tables*/
use PET_OWNER_DB;

Tables:

1.Table Name :PET_OWNER

/*1.Table Name :PET_OWNER */
create table PET_OWNER(
OWNER_ID int primary key,
FIRST_NAME varchar(250),
LAST_NAME varchar(250),
PHONE varchar(20),
EMAIL varchar(50));

/*Inserting records*/
insert into PET_OWNER values (1,'Marsha','Downs','240-855-2345','[email protected]');

/*selecting records*/
select * from PET_OWNER;

Screen in SSMS :

******************************************

2.Table Name :PET

/*2.Table Name :PET*/
create table PET(
PET_ID int primary key,
PET_NAME varchar(50),
PET_TYPE varchar(20),
BREED varchar(50),
DOB date,
OWNER_ID int foreign key references PET_OWNER(OWNER_ID));

/*Inserting records*/
insert into PET values (1,'King','Dog','Cashmere','27-Feb-14',1);

/*selecting records*/
select * from PET;

Screen in SSMS :

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.


Related Solutions

Explain categorization and the two main types of categories—natural categories and artificial categories. Describe how the...
Explain categorization and the two main types of categories—natural categories and artificial categories. Describe how the prototype theory explains the formation of categories.
1a. What is the area under standard normal density curve to the left of 1.96? 1b....
1a. What is the area under standard normal density curve to the left of 1.96? 1b. What is the 99th percentile of standard normal density curve? 1c. If 5-year survival rate is 24% for a certain disease, what is the probability that at least 3 out of 10 patients will survive more than 5 years? how about at least 30 out of 100 patients? (use central limit theorem) 1d. What is the name of the theorem that tells us the...
1a. What is the area under standard normal density curve to the left of 1.96? 1b....
1a. What is the area under standard normal density curve to the left of 1.96? 1b. What is the 99th percentile of standard normal density curve? 1c. If 5-year survival rate is 24% for a certain disease, what is the probability that at least 3 out of 10 patients will survive more than 5 years? how about at least 30 out of 100 patients? (use central limit theorem) 1d. What is the name of the theorem that tells us the...
Briefly explain what are coastal engineering structures and the differences between the two categories. Provide a...
Briefly explain what are coastal engineering structures and the differences between the two categories. Provide a brief history of the structure Ripraps and Gabions (including its category)   How widely is the structure used?
In Software engineer, Technical testing metrics fall into two major categories. What are they? explain in...
In Software engineer, Technical testing metrics fall into two major categories. What are they? explain in detail.
Why is regression analysis necessary in business? What two categories of regression models are used? Explain
Why is regression analysis necessary in business? What two categories of regression models are used? Explain
What are the two categories of liabilities reported on the balance sheet?
  Question: What are the two categories of liabilities reported on the balance sheet? Provide examples of each.
(1a) Explain what happens in Oxidation AND Reduction electrochemical reactions. (1b) What happens to the ions...
(1a) Explain what happens in Oxidation AND Reduction electrochemical reactions. (1b) What happens to the ions formed in the oxidation reaction?
In the Topic Materials, you learned about exporting SQL Server Data to Excel. Explain the two...
In the Topic Materials, you learned about exporting SQL Server Data to Excel. Explain the two options for exporting data using the SQL Server Import and Export Wizard, and provide examples of when each option should be selected.
What is Macroeconomic and compare the two categories of economics Macroeconomic and Microeconomic
What is Macroeconomic and compare the two categories of economics Macroeconomic and Microeconomic
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT