learn-co-curriculum / dsc-database-admin-101-lab Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
A student reported this to me and said there seems to be a disconnect between the solution and lab.
https://learning.flatironschool.com/courses/5329/assignments/187391?module_item_id=417321
# Delete the duplicate entry
cur.execute("""DELETE FROM contactInfo
WHERE telephone = 3259909290;""")
The goal for this snippit of code is to delete a duplicate entry, but the solution deletes all entries.
cur.execute("""SELECT firstName, lastName, telephone, COUNT()
FROM contactInfo
GROUP BY firstName, lastName, telephone
HAVING COUNT() > 1;""").fetchall()
cur.execute("""SELECT userID
FROM contactInfo
WHERE tel_num = 3259909290;""").fetchall()
cur.execute("""DELETE FROM contactInfo
WHERE userID = 6""")
The code finding the duplicate entry can still be used. Then using the telephone number find the primary keys of all the entries containing that number. Using the primary key delete the duplicate. In the case of this example the primary keys were 5 and 6. Code can be adjusted if there are multiple duplicate entries by changing the operator to > lowest_userID.
The file "school.sqlite" - exists in the forked repo (master branch), causes error due to pre-existing tables. Suggest removing to avoid errors. Otherwise, students need to delete it or use another workaround to move through the lab. Thanks!
I believe it should only be in the solution branch
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.