Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can I please have help with these questions? QUESTION 22 For Questions 22 to 24

ID: 3873764 • Letter: C

Question

Can I please have help with these questions?

QUESTION 22

For Questions 22 to 24 download the MySQL dump (DUMP below) and import it into MySQL.

Based on the Medicines database you imported, complete the SQL statement below to add the simple attribute manufacturerName to the Manufacturer table. The name of a manufacturer should be no longer than 40 characters. There is a blank in the query, and you should enter the required text in the box below.

When completing the statement, ensure you use the same naming conventions as other columns in the database and choose the most appropriate datatype. Your answer will be marked incorrect if there is a spelling mistake, missing spaces, or unnecessary spaces.

ALTER TABLE Manufacturer ADD __________;

QUESTION 23

Based on the Medicines database you imported, complete the SQL statement below to add the branded drug Somac 40mg (generic name Pantoprazole) to the database. Somac is manufactured by McBraun (manufacturerID 3).

When completing the statement, ensure you use the same naming conventions as other columns in the database. Your answer will be marked incorrect if there is a spelling mistake, missing spaces, or unnecessary spaces.

INSERT INTO __________ (brandName, strength, __________ , __________ ) __________ (" __________ ',' __________ ', 'Pantoprazole', '3');

QUESTION 24

Based on the Medicines database you imported, complete the SQL statement below to add the table Locations to record the state (up to 6) a Manufacturer can operate in.

When completing the statement, ensure you use the same naming conventions as other columns in the database and choose the most appropriate datatype. Your answer will be marked incorrect if there is a spelling mistake, missing spaces, or unnecessary spaces.

__________ Locations (

__________

__________ CHAR(3),

PRIMARY KEY (  __________) ,

FOREIGN KEY (manufacturerID) REFERENCES Manufacturer (manufacturerID)

);

SQL DUMP FOR QUESTIONS 22-24

CREATE DATABASE IF NOT EXISTS `2016_Quiz2_Medicines` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `2016_Quiz2_Medicines`;

-- MySQL dump 10.13 Distrib 5.6.17, for osx10.6 (i386)

--

-- Host: localhost Database: Medicines

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

-- Server version 5.6.19

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;

/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;

/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;

/*!40101 SET NAMES utf8 */;

/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;

/*!40103 SET TIME_ZONE='+00:00' */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;

/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--

-- Table structure for table `Brands`

--

DROP TABLE IF EXISTS `Brands`;

/*!40101 SET @saved_cs_client = @@character_set_client */;

/*!40101 SET character_set_client = utf8 */;

CREATE TABLE `Brands` (

`brandName` varchar(30) NOT NULL,

`strength` varchar(10) NOT NULL,

`genericName` varchar(30) NOT NULL,

`manufacturerID` varchar(30) NOT NULL,

PRIMARY KEY (`brandName`,`strength`),

KEY `genericName` (`genericName`),

CONSTRAINT `brands_ibfk_1` FOREIGN KEY (`genericName`) REFERENCES `Medicines` (`genericName`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*!40101 SET character_set_client = @saved_cs_client */;

--

-- Dumping data for table `Brands`

--

LOCK TABLES `Brands` WRITE;

/*!40000 ALTER TABLE `Brands` DISABLE KEYS */;

INSERT INTO `Brands` VALUES ('Amoxil','250mg','Amoxicillin','1'),('Norvapine','10mg','Amlodipine','1'),('Norvapine','5mg','Amlodipine','1'),('Norvasc','5mg','Amlodipine','2'),('Zoloft','100mg','Sertraline','3'),('Zoloft','50mg','Sertraline','3');

/*!40000 ALTER TABLE `Brands` ENABLE KEYS */;

UNLOCK TABLES;

--

-- Table structure for table `Manufacturer`

--

DROP TABLE IF EXISTS `Manufacturer`;

/*!40101 SET @saved_cs_client = @@character_set_client */;

/*!40101 SET character_set_client = utf8 */;

CREATE TABLE `Manufacturer` (

`manufacturerID` int(4) NOT NULL,

PRIMARY KEY (`manufacturerID`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*!40101 SET character_set_client = @saved_cs_client */;

--

-- Dumping data for table `Manufacturer`

--

LOCK TABLES `Manufacturer` WRITE;

/*!40000 ALTER TABLE `Manufacturer` DISABLE KEYS */;

INSERT INTO `Manufacturer` VALUES (1),(2),(3),(4);

/*!40000 ALTER TABLE `Manufacturer` ENABLE KEYS */;

UNLOCK TABLES;

--

-- Table structure for table `Medicines`

--

DROP TABLE IF EXISTS `Medicines`;

/*!40101 SET @saved_cs_client = @@character_set_client */;

/*!40101 SET character_set_client = utf8 */;

CREATE TABLE `Medicines` (

`genericName` varchar(30) NOT NULL,

`class` varchar(30) NOT NULL,

PRIMARY KEY (`genericName`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*!40101 SET character_set_client = @saved_cs_client */;

--

-- Dumping data for table `Medicines`

--

LOCK TABLES `Medicines` WRITE;

/*!40000 ALTER TABLE `Medicines` DISABLE KEYS */;

INSERT INTO `Medicines` VALUES ('Amlodipine','CCB'),('Amoxicillin','Penicillin'),('Captopril','ACEi'),('Ceftriaxone','Cephalospo'),('Diazepam','Benzodiaz'),('Escitalopram','SSRI'),('Frusemide','LoopDiure'),('Metoprolol','bblocker'),('Risperidone','AAntipsycho'),('Sertraline','SSRI'),('Temazepam','Benzodiaz'),('Pantoprazole','PPI');

/*!40000 ALTER TABLE `Medicines` ENABLE KEYS */;

UNLOCK TABLES;

--

-- Dumping routines for database 'Medicines'

--

/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;

/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;

/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

Explanation / Answer

22)

In this question, you want to add a new column into the Manufacturer table. manufacturerName should not be more than 40 characters so declare its size as 40. varchar is used as its data type.It can also be just char.

ALTER TABLE Manufacturer ADD manufacturerName varchar(40);

23)

In this a new record is to be added to the Brands table the columns in the brnd table are written after table name and the respective values are placed after values

INSERT INTO Brands (brandName,strength,genericName,manufacturerID) values ('Somac','40mg','Pantoprazole','3');

24)

In this a new table is to be created to recors the state of the manufacturer.

CREATE TABLE Locations (manufacturerID int(4),state CHAR(3),PRIMARY KEY (manufacturerID,state),
FOREIGN KEY (manufacturerID) REFERENCES Manufacturer (manufacturerID));

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote