ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

How would a stored function named PI() written in the database 'sampdb' be called?

Answer & Solution
Correct Answer: Option B
This question asks how you call a stored function named PI() that's stored in the database sampdb.

Here's how to understand the options:
Option A: PI()
This would try to call a function named PI() in the current database you're connected to, not necessarily sampdb.
Option B: sampdb.PI()
This is the correct way to call the function. You specify the database name (sampdb) followed by a dot (.) and then the function name (PI()).
Option C: MySQL.PI()
This would try to call a function named PI() within the MySQL system database, which is unlikely where your function is stored.
Option D: db.PI()
This is incorrect because "db" isn't a recognized database name in this scenario.

Therefore, the correct answer is Option B: sampdb.PI()
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.