文章目录
- Python for Everybody
- 课程简介
- Quiz 16_3-1: Databases
- 单选题(1-11)
- 操作题
- Autograder: Single Table SQL
Python for Everybody
课程简介
Python for Everybody 零基础程序设计(Python 入门)
- This course aims to teach everyone the basics of programming computers using Python. 本课程旨在向所有人传授使用 Python 进行计算机编程的基础知识。
- We cover the basics of how one constructs a program from a series of simple instructions in Python. 我们介绍了如何通过 Python 中的一系列简单指令构建程序的基础知识。
- The course has no pre-requisites and avoids all but the simplest mathematics. Anyone with moderate computer experience should be able to master the materials in this course. 该课程没有任何先决条件,除了最简单的数学之外,避免了所有内容。任何具有中等计算机经验的人都应该能够掌握本课程中的材料。
- This course will cover Chapters 1-5 of the textbook “Python for Everybody”. Once a student completes this course, they will be ready to take more advanced programming courses. 本课程将涵盖《Python for Everyday》教科书的第 1-5 章。学生完成本课程后,他们将准备好学习更高级的编程课程。
- This course covers Python 3.
coursera
Python for Everybody 零基础程序设计(Python 入门)
Charles Russell Severance
Clinical Professor
个人主页
Twitter
University of Michigan
课程资源
coursera原版课程视频
coursera原版视频-中英文精校字幕-B站
Dr. Chuck官方翻录版视频-机器翻译字幕-B站
PY4E-课程配套练习
Dr. Chuck Online - 系列课程开源官网
Quiz 16_3-1: Databases
Databases give us very fast random access to large amounts of data. There is a lot of material in this chapter as we learn the Structured Query Language (SQL).
单选题(1-11)
- Structured Query Language (SQL) is used to (check all that apply)
- Insert data
- Delete data
- Create a table
- Check Python code for errors
- Which of these is the right syntax to make a new table?
- CREATE TABLE people;
- MAKE DATASET people;
- MAKE people;
- CREATE people;
- Which SQL command is used to insert a new row into a table?
- INSERT INTO
- INSERT ROW
- INSERT AFTER
- ADD ROW
- Which command is used to retrieve all records from a table?
- RETRIEVE all FROM User
- RETRIEVE * FROM Users
- SELECT all FROM Users
- SELECT * FROM Users
- Which keyword will cause the results of the query to be displayed in sorted order?
- None of these
- ORDER BY
- GROUP BY
- WHERE
- In database terminology, another word for table is
- attribute
- relation
- row
- field
- In a typical online production environment, who has direct access to the production database?
- Developer
- Project Manager
- Database Administrator
- UI/UX Designer
- Which of the following is the database software used in this class?
- SQLite
- Postgres
- SQL Server
- MySQL
- Oracle
- What happens if a DELETE command is run on a table without a WHERE clause?
- All the rows without a primary key will be deleted
- All the rows in the table are deleted
- The first row of the table will be deleted
- It is a syntax error
- Which of the following commands would update a column named “name” in a table named “Users”?
- Users->name = ‘new name’ WHERE …
- UPDATE Users (name) VALUES (‘new name’) WHERE …
- Users.name=‘new name’ WHERE …
- UPDATE Users SET name=‘new name’ WHERE …
- What does this SQL command do?
SELECT COUNT(*) FROM Users
Hint: This is not from the lecture
- It counts the rows in the table Users
- It only retrieves the rows of Users if there are at least two rows
- It adds a COUNT column to the Users table
- It is a syntax errror
操作题
Autograder: Single Table SQL
Instructions
If you don’t already have it, install the SQLite Browser from http://sqlitebrowser.org/.
Then, create a SQLITE database or use an existing database and create a table in the database called “Ages”:
CREATE TABLE Ages (
name VARCHAR(128),
age INTEGER
)
Then make sure the table is empty by deleting any rows that you previously inserted, and insert these rows and only these rows with the following commands:
DELETE FROM Ages;
INSERT INTO Ages (name, age) VALUES ('Emile', 13);
INSERT INTO Ages (name, age) VALUES ('Caidan', 23);
INSERT INTO Ages (name, age) VALUES ('Kirsteen', 19);
INSERT INTO Ages (name, age) VALUES ('Patsy', 33);
INSERT INTO Ages (name, age) VALUES ('Adain', 20);
INSERT INTO Ages (name, age) VALUES ('Lachlan', 25);
Once the inserts are done, run the following SQL command:
SELECT hex(name || age) AS X FROM Ages ORDER BY X
Find the first row in the resulting record set and enter the long string that looks like 53656C696E613333.
Note: This assignment must be done using SQLite - in particular, the SELECT
query above will not work in any other database. So you cannot use MySQL or Oracle for this assignment.