Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE SUBMIT MAC TERMINAL SQL COMMAND CLEARLY !!!!!!! PART 1: In class we discussed type affinity in sqlite3. Here's the link to the documentation about

image text in transcribed

PLEASE SUBMIT MAC TERMINAL SQL COMMAND CLEARLY !!!!!!!

PART 1: In class we discussed type affinity in sqlite3. Here's the link to the documentation about it. To summarize the link above, sqlite3 databases ( unless marked STRICT ) can store any datatype in any column, regardless of the column's datatype. For example, if you CREATE TABLE student( name TEXT ); You can still INSERT INTO student VALUES (1); You would think that this would generate an error because 1 is not TEXT, but sqlite3 is flexible with datatypes ( unlike other databases ). Create a table with 5 columns "column1", "column2",..., "column5", each of a different type. Then insert 10 rows and be sure to insert the wrong datatype for every.single.column. Then run the command SELECT typeof(column1), typeof(column2), typeof(column3), typeof(column4), typeof(column5) FROM your_table; The output should match the types you inserted, not the type of the column. Hopefully you find this interesting! PART 2: How does the type flexibility affect joins? Do the joins require columns to have the same type? Create two tables, one with an INT PRIMARY KEY and the other with a TEXT FOREIGN KEY. Add one row into each table such that you can inner join them. Perform the inner join. If it is not possible to do this, tell me why. I'm not sure if this is possible, so we'll learn together! My guess: should be possible. Submit * two .sql files called part1.sql and part2.sql ( or something similar) with the commands you ran * a selfie with the output of your typeof() query from part 1. * a selfie with the output of part2 if it is possible to perform the join. 50 points for doing each part + taking the selfie

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

=+Trainers from headquarters? Local trainers? Independent trainers?

Answered: 1 week ago