==Questions to Answer==
 
==Questions to Answer==
 
===DDL (create table) statements===
 
===DDL (create table) statements===
* create table Applicationfile(ApplNo int, ApplType varchar, SponsorApplicant varchar, MostRecentLabelAvailableFlag boolean, CurrentPatentFlag boolean, ActionType varchar, Chemical_Type int, Ther_Potential varchar, Orphan_Code varchar)
+
* create table applicationfile(ApplNo int primary key, ApplType varchar, SponsorApplicant varchar, MostRecentLabelAvailableFlag boolean, CurrentPatentFlag boolean, ActionType varchar, Chemical_Type int, Ther_Potential varchar, Orphan_Code varchar)
 
* create table Productfile (ApplNo int, ProductNo int, Form varchar, Dosage varchar, ProductMktStatus varchar, TECode varchar, ReferenceDrug int, drugname varchar, activeingred varchar)
 
* create table Productfile (ApplNo int, ProductNo int, Form varchar, Dosage varchar, ProductMktStatus varchar, TECode varchar, ReferenceDrug int, drugname varchar, activeingred varchar)
 
===sed command sequences===
 
===sed command sequences===
 
#  Using the command line, how can you determine the number of records in each file? Provide the command.
 
#  Using the command line, how can you determine the number of records in each file? Provide the command.
 
#* For application:  
 
#* For application:  
wc application.txt
+
#**wc application.txt
 
#** Contains 19747 rows, so 19746 have data
 
#** Contains 19747 rows, so 19746 have data
 
#* For Product:  
 
#* For Product:  
wc product.txt
+
#**wc product.txt
 
#** Contains 32771 rows, so 32770 have data
 
#** Contains 32771 rows, so 32770 have data
 
#Using SQL, how can you determine the number of records in the table corresponding to the file? Provide the SQL select statement.
 
#Using SQL, how can you determine the number of records in the table corresponding to the file? Provide the SQL select statement.
 
#* For applicationfile:
 
#* For applicationfile:
select count (*) from applicationfile
+
#**select count (*) from applicationfile
 
#** Has 19746 entries (deleted first row of data)
 
#** Has 19746 entries (deleted first row of data)
 
#* For Productfile:
 
#* For Productfile:
select count (*) from Productfile
+
#**select count (*) from Productfile
 
#** Has 32770 entries (deleted first row of data)
 
#** Has 32770 entries (deleted first row of data)
 
# In your database, are these numbers the same or different? Explain why you think so.
 
# In your database, are these numbers the same or different? Explain why you think so.
    
# What are the names of the drug products that are administered in the form INJECTABLE;INTRAVENOUS, SUBCUTANEOUS?
 
# What are the names of the drug products that are administered in the form INJECTABLE;INTRAVENOUS, SUBCUTANEOUS?
select drugname from Productfile where form = 'INJECTABLE;INTRAVENOUS, SUBCUTANEOUS'
+
#*select drugname from Productfile where form = 'INJECTABLE;INTRAVENOUS, SUBCUTANEOUS'
 
#* LOVENOX, VELCADE, VIDAZA, ENOXAPARIN SODIUM
 
#* LOVENOX, VELCADE, VIDAZA, ENOXAPARIN SODIUM
 
# What are the names of the drug products whose active ingredient (activeingred) is ATROPINE?
 
# What are the names of the drug products whose active ingredient (activeingred) is ATROPINE?
select drugname from Productfile where activeingred = 'ATROPINE'
+
#*select drugname from Productfile where activeingred = 'ATROPINE'
 
#* ATROPEN, ATROPINE
 
#* ATROPEN, ATROPINE
 
# In what forms and dosages can the drug product named BENADRYL be administered?
 
# In what forms and dosages can the drug product named BENADRYL be administered?
Exception encountered, of type "Error"
[a37f55f1] /biodb/fall2015/index.php?diff=prev&oldid=2339&title=Emilysimso_Week_6 Error from line 434 of /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php: Call to undefined function each()
Backtrace:
#0 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(544): DiffEngine->diag()
#1 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(344): DiffEngine->compareSeq()
#2 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(227): DiffEngine->diffLocal()
#3 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(721): DiffEngine->diff()
#4 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(859): Diff->__construct()
#5 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(980): MappedDiff->__construct()
#6 /apps/xmlpipedb/biodb/fall2015/includes/diff/TableDiffFormatter.php(194): WordLevelDiff->__construct()
#7 /apps/xmlpipedb/biodb/fall2015/includes/diff/DiffFormatter.php(140): TableDiffFormatter->changed()
#8 /apps/xmlpipedb/biodb/fall2015/includes/diff/DiffFormatter.php(111): DiffFormatter->block()
#9 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(888): DiffFormatter->format()
#10 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(802): DifferenceEngine->generateTextDiffBody()
#11 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(733): DifferenceEngine->generateContentDiffBody()
#12 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(662): DifferenceEngine->getDiffBody()
#13 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(632): DifferenceEngine->getDiff()
#14 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(453): DifferenceEngine->showDiff()
#15 /apps/xmlpipedb/biodb/fall2015/includes/page/Article.php(795): DifferenceEngine->showDiffPage()
#16 /apps/xmlpipedb/biodb/fall2015/includes/page/Article.php(506): Article->showDiffPage()
#17 /apps/xmlpipedb/biodb/fall2015/includes/actions/ViewAction.php(44): Article->view()
#18 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(395): ViewAction->show()
#19 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(273): MediaWiki->performAction()
#20 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(566): MediaWiki->performRequest()
#21 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(414): MediaWiki->main()
#22 /apps/xmlpipedb/biodb/fall2015/index.php(44): MediaWiki->run()
#23 {main}