Examveda

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

A. PI()

B. sampdb.PI()

C. MySQL.PI()

D. db.PI()

Answer: Option B

Solution (By Examveda Team)

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()

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous