All quizzesEasy
Schema & Basic CRUD
Preview — 3 of 10 questions
What is required inside the datasource block in schema.prisma?
AOnly the url field is required; provider is optional and defaults to postgresql
BThe datasource block is optional if using Prisma Accelerate
Cprovider, url, and schema (schema name) are all required
DBoth provider (database type, e.g., postgresql, mysql, sqlite) and url (the database connection string, usually an env variable) are required
What is the difference between @default(autoincrement()) and @default(cuid())?
Aautoincrement() generates UUIDs; cuid() generates sequential integers
Bautoincrement() generates sequential integers (1, 2, 3…) managed by the database; cuid() generates collision-resistant unique string IDs generated by Prisma Client (not the database)
CBoth generate integers but cuid() is guaranteed to be globally unique across databases
Dautoincrement() requires PostgreSQL; cuid() works with any database
What is the difference between prisma generate, prisma migrate dev, and prisma db push?
AAll three commands create migration files; they differ only in file naming
Bprisma db push is for production deployments; prisma migrate dev is for local development only in all cases
Cprisma generate regenerates the Prisma Client from schema; prisma migrate dev creates a migration SQL file and applies it (for tracked, versioned changes); prisma db push syncs the schema directly to the database without creating migration files (for prototyping)
Dprisma generate applies migrations; prisma migrate dev only generates the schema diff
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.